﻿using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Configuration;
using SimpleCrawler.Entity;
using System;
using System.Collections.Generic;
using System.Text;

namespace SimpleCrawler.EntityFramework
{
    public class SqlDbContext : DbContext
    {
        public SqlDbContext(IConfiguration configuration)
        {
            Configuration = configuration;
        }
        public IConfiguration Configuration { get; }
        protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
        {
            optionsBuilder.UseSqlServer(Configuration.GetSection("ConnectionStrings")["SqlServerConnection"]);
        }

        public DbSet<WD_Question> Users { get; set; }
        public DbSet<WD_Answer> Roles { get; set; }

        protected override void OnModelCreating(ModelBuilder modelBuilder)
        {            
        }
    }
}
